<?
include_once '/var/www/html/new/d/module/api/ctrip/ctrip.class.php';
include_once '/var/www/html/new/d/module/api/function.class.php';
$ctrip = new Ctrip();
$PFT_infunction = new AllFunction();
$SearchOrder = $ctrip->SeachOrder();
if(empty($SearchOrder)) exit("查无订单");
foreach($SearchOrder['OrderList'] as $os ){
	if($os['OrderStatus'] == 7){ //已使用订单
		$SeachPftOrder = $PFT_infunction->Select_REMOorder($os['OrderId']);
		$UUordernum = (int)$SeachPftOrder->Rec->UUordernum;
		if($UUordernum){
			$UUaids=(string)$SeachPftOrder->Rec->UUaids;
			$UUstatus=(string)$SeachPftOrder->Rec->UUstatus;
			if($UUaids == 0){
				$aid = (string)$SeachPftOrder->Rec->UUaid;
			}else{
				$UUaidss= explode(',',$UUaids);
				$aid = $UUaidss[0];
			}
			if($aid == 4274 && $UUstatus == 0){ //携程分销
				$UUsalerid = (string)$SeachPftOrder->Rec->UUsalerid;
				$UUcode = (string)$SeachPftOrder->Rec->UUcode;		
				$r = $PFT_infunction->Compatible_Check_IN($UUsalerid,$UUcode,"");			
				if($r != 100){
					$ctrip->logfile($os['OrderId']."->".$UUordernum."->".$r,'/var/www/html/new/d/module/api/ctrip/ctrip_terminal.txt');
				}
			}else{
				$ctrip->logfile("不属于携程订单或者订单不是未使用状态：".$os['OrderId']."->".$UUordernum,'/var/www/html/new/d/module/api/ctrip/ctrip_terminal.txt');
			}

		}else{
			$ctrip->logfile("未找到订单：".$os['OrderId'],'/var/www/html/new/d/module/api/ctrip/ctrip_terminal.txt');
		}
	}
}
?>